package grape.house.rest.estatealbum.mvc;

import grape.common.rest.advice.DisableGRB;
import grape.common.rest.advice.DisableGRM;
import grape.common.rest.mvc.BaseController;
import grape.common.rest.mvc.SuperController;
import grape.house.rest.estatealbum.vo.EstateAlbumVo;
import grape.house.service.estatealbum.api.IEstateAlbumService;
import grape.house.service.estatealbum.po.EstateAlbum;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

import java.util.List;

/**
 * 楼盘相册内部调用接口
 * Created by yangwei
 * Created at 2020/9/27 16:50
 */
@RestController
@RequestMapping("/house/estatealbum")
@ApiIgnore
public class EstateAlbumInnerController extends BaseController<EstateAlbumVo, EstateAlbum> {

    @Autowired
    private IEstateAlbumService iEstateAlbumService;


    @DisableGRM
    @DisableGRB
    @GetMapping("/inner/trans/support")
    public boolean support(String type){
        return iEstateAlbumService.support(type);
    }
    @DisableGRM
    @DisableGRB
    @GetMapping("/inner/trans")
    public String trans(String type,String key){
        return iEstateAlbumService.trans(type,key);
    }

    @GetMapping("/inner/getEstateAlbumById")
    public EstateAlbum getEstateAlbumById(String id){
        return iEstateAlbumService.getById(id);
    }

    @GetMapping("/inner/getEstateAlbumVoById")
    public EstateAlbumVo getEstateAlbumVoById(String id){
        return queryById(id);
    }

    @GetMapping("/inner/getEstateAlbumByEstateId")
    public List<EstateAlbum> getEstateAlbumByEstateId(String estateId){
        return iEstateAlbumService.getByEstateId(estateId);
    }
    @GetMapping("/inner/getEstateAlbumByEstateIdAndPropertyTypeId")
    public List<EstateAlbum> getByEstateIdAndPropertyTypeId(String estateId,String propertyTypeId){
        return iEstateAlbumService.getByEstateIdAndPropertyTypeId(estateId,propertyTypeId);
    }
}
